package com.sohoometer;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import org.junit.Test;

public class TestTime {
	@Test
	public void testTime() throws Exception {
		Date date = new Date();
		Calendar instance = Calendar.getInstance();
		instance.setTime(date);
		instance.roll(Calendar.DATE, false);
		Date time = instance.getTime();
		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd  HH:mm:ss");
		String format = dateFormat.format(time);
		System.out.println(format);
	}
}
